% Calculate characteristic impedance from input impedance
%using the 3rd to the 15th harmonics

aantal=length(pressure);
T=max(time);

harmfirst=1+ceil(3*T);
harmlast=1+floor(15*T);
Z0=mean(Zinmod(harmfirst:harmlast));
